<?php
/**
 * System_program Active Record
 * @author  <your-name-here>
 */
class SystemProgram extends TRecord
{
    const TABLENAME = 'system_program';
    const PRIMARYKEY= 'id';
    const IDPOLICY =  'max'; // {max, serial}
    
    /**
     * Constructor method
     */
    public function __construct($id = NULL)
    {
        parent::__construct($id);
        parent::addAttribute('name');
        parent::addAttribute('controller');
    }
    
    public function store()
    {
        
        $valida = new TUniqueValidator;
        $valida->validate('Classe de Controle', $this->controller, array('database' => 'permission', 'model' => 'SystemProgram','field' => 'controller', 'id' => $this->id));
               
        // store the object itself
        parent::store();
    }              
    
}
?>